<?php
if(isset($query))
    $fila = $query->row();
?>
<div class="yui-g">
    <?php if(isset($query)):?>
    <form action="<?=base_url()?>index.php/admin/admin/modificar" method="post">
        <?php else:?>
        <form action="<?=base_url()?>index.php/admin/admin/guardar" method="post">
            <?php endif;?>
            <table border="0">
                <tbody>
                    <tr>
                        <td><label><?=lang('nombre_usuarios');?></label></td>
                        <td><input type="text" name="name" <?php if(isset($query)) echo 'value="'.$fila->name.'"';?> size="50" /></td>
                    </tr>
                    <tr>
                        <td><label><?=lang('nombre_de_usuarios');?></label></td>
                        <td><input type="text" name="username" <?php if(isset($query)) echo 'value="'.$fila->username.'"';?> size="50" /></td>
                    </tr>
                    <tr>
                        <td><label><?=lang('clave_usuarios');?></label></td>
                        <td><input type="password" name="password" size="50" /></td>
                    </tr>
                    <tr>
                        <td><label><?=lang('mail_usuarios');?></label></td>
                        <td><input type="text" name="email" size="50" <?php if(isset($query)) echo 'value="'.$fila->email.'"';?> /></td>
                    </tr>
                    <tr>
                        <td><label>Telefono</label></td>
                        <td><input type="text" name="phone_1" size="50" <?php if(isset($query)) echo 'value="'.$fila->phone_1.'"';?>  /></td>
                    </tr>
                    <tr>
                        <td><label>Direccion</label></td>
                        <td><input type="text" name="address_1" size="50" <?php if(isset($query)) echo 'value="'.$fila->address_1.'"';?> /></td>
                    </tr>
                    <tr>
                        <td><label>Ciudad</label></td>
                        <td><input type="text" name="city" size="50" <?php if(isset($query)) echo 'value="'.$fila->city.'"';?>  /></td>
                    </tr>
                    <tr>
                        <td><label>Provincia</label></td>
                        <td><input type="text" name="state" size="50" <?php if(isset($query)) echo 'value="'.$fila->state.'"';?>  /></td>
                    </tr>
                    <tr>
                        <td><label>Mail Vendedor</label></td>
                        <td><input type="text" name="mailv" size="50" <?php if(isset($query)) echo 'value="'.$fila->mailv.'"';?>/></td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <input type="hidden" name="id" value="<?if(isset($query)) echo $fila->id;?>" />
                            <input type="submit" name="Enviar" value="<?=lang('guardar_usuarios');?>">
                        </td>
                    </tr>
                </tbody>
            </table>

        </form>
</div>
